package yuliang.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yuliang.domain.ResponseResult;
import yuliang.domain.User;
import yuliang.mapper.UserMapper;

import java.util.List;

@RestController

public class HiController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/test")
    public ResponseResult TestMP(){
        List<User> users = userMapper.selectList(null);
        return new ResponseResult<>(200,users);
    }

    @RequestMapping("/hi")
    @PreAuthorize("hasAuthority('system:test:list')")
    public String sqyHi(){
        return "hi";
    }
}
